{% extends 'mom.html' %}    <!-- 模板继承 -->
{% load static %}   <!-- 加载静态资源 -->

{% block css %}
    <link href="{% static 'css/bootstrap-datepicker.css' %}" rel="stylesheet" type="text/css"/>
{% endblock %}

{% block content %}
    <div>
        <h1>编辑 <span class="label label-default">FM</span></h1>

        <form method="post" novalidate><!-- 默认跳转本地址 -->
            {% csrf_token %}
            <div class="clearfix">
                <!-- 循环操作 -->
                {% for i in form %}
                    <div class="col-xs-6">
                        <div class="input-group">
                            <label>{{ i.label }}</label>
                            {{ i }}
                        </div>
                        <span style="color: red">{{ i.errors.0 }}</span>
                    </div>
                {% endfor %}
            </div>
            <br/>
            <div class="btn-group" role="group" aria-label="...">
                <input type="submit" class="btn btn-default" value="提交"/>
            </div>
        </form>

    </div>
    <div class="alert alert-danger">{{ err }}</div>
{% endblock %}

{% block js %}
    <script type="text/javascript" src="{% static 'js/bootstrap-datepicker.js' %}"></script>
    <script type="text/javascript" src="{% static 'js/bootstrap-datepicker.zh-CN.min.js' %}"></script>

    <script>    //日期插件
    $(function () {
        $('#id_creat_time').datepicker({    //#id_creat_time 是id(<input id="id_creat_time">)
            format: 'yyyy-mm-dd',
            //startDate: '0',
            language: 'zh-CN',
            autoclose: true
        });
    })
    </script>
{% endblock %}
